Diagnostic port for inter-switch link testing in electrical, optical and remote loopback modes

ABSTRACT

A diagnostic testing utility is used to perform single link diagnostics tests including an electrical loopback test, an optical loopback test, a link traffic test, and a link distance measurement test. To perform the diagnostic tests, two ports at each end of a link are identified and then statically configured by a user. The ports will be configured as D_Ports and as such will be isolated from the fabric with no data traffic flowing through them. The ports will then be used to send test frames to perform the diagnostic tests.

TECHNICAL FIELD

The present invention relates to the field of computer networking, andin particular to techniques for performing link level diagnostics in aswitch fabric.

BACKGROUND

Storage area networks (SANs) are typically implemented to interconnectdata storage devices and data servers or hosts, using network switchesto provide interconnectivity across the SAN. SANs may be complex systemswith many interconnected computers, switches, and storage devices. Theswitches are typically configured into a switch fabric, and the hostsand storage devices are connected to the switch fabric through ports ofthe network switches that comprise the switch fabric. Most commonly,Fibre Channel (FC) protocols are used for data communication across theswitch fabric, as well as for the setup and teardown of connections toand across the fabric, although these protocols may be implemented ontop of Ethernet or Internet Protocol (IP) networks.

Many SANs rely on the FC protocol. The FC protocol defines standardmedia and signaling conventions for transporting data in a serialfashion. It also provides an error correcting channel code and a framestructure for transporting the data. Many FC switches provide at leastsome degree of automatic configurability. For example, they mayautomatically sense when a new inter-switch link (ISL) becomes active,and may initiate an initialization process to discover what the linkconnects to. The switch may automatically determine various parametersfor the link (e.g. link speed). As FC networks are created, updated,maintained and de-commissioned, switches may be enabled, disabled orreconfigured, and links may be added or removed.

Over time, FC networks have become more complex, with multiple fabricsinvolving several switches that use inter-switch links (ISLs) connectedto switch ports (E_ports) on the switches. As FC networks have becomemore complex, the network speeds have also increased significantly. Asfaster networks are implemented, media and cable tolerance become moreimportant for avoiding degraded performance and cyclic redundancy check(CRC) errors. At the same time, as larger networks are developed,diagnostic of optics and cables become more and more time consuming andintrusive. Current switches have two basic types of built-indiagnostics. First, the SFP electro-optical modules have digitaldiagnostics, but these only operate at the SFP component level. Second,a command line interface (CLI) tool may be provided to allow frames tobe injected and circulated on a specific link, but the end result isonly a good and bad indication, which does not greatly aid diagnosis.Thus, troubleshooting suspected link errors with the existing built-intools is time consuming and can become a daunting task. The use ofexternal separate testing tools is also cumbersome and brings alongseparate problems not present with built-in tools

It would be desirable to implement an efficient network diagnosticmethod to more efficiently troubleshoot larger networks, therebyimproving the speed, efficiency, and reliability of these networks.

SUMMARY

In one embodiment, a network link level diagnostic tool is disclosed.The diagnostic tool can monitor and set alerts for digital diagnostics,test both ends of the connectivity to validate that the links are withinbudget, saturate a link with a representative SAN traffic profile tovalidate fabric performance, monitor and trend for the integrity of theoptics during its operational life cycle, and granularly measures cabledistance to determine physical limitation or performance degradation ofthe link over time.

BRIEF DESCRIPTIONS OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an exemplary Fibre Channelnetwork.

FIG. 2 is a block diagram illustrating an exemplary Fibre Chancelnetwork implementing D_Port diagnostics according to one embodiment.

FIG. 3 is a block diagram of an exemplary switch.

FIG. 4 is a flowchart illustrating a method for configuring networkports as D_Ports according to one embodiment.

FIG. 5 is a block diagram illustrating the D_Port diagnostic testsperformed on inter-switch links according to one embodiment.

FIG. 6 is a ladder diagram illustrating the states of a D_Port as itwill go through a D_Port diagnostic according to one embodiment.

FIG. 7 is a graph diagrams illustrating the states of a D_Port as itwill go through a D_Port diagnostic according to one embodiment.

DETAILED DESCRIPTIONS

An exemplary FC network is illustrated in FIG. 1. As illustrated, the FCnetwork of FIG. 1 includes two FC fabrics, a fabric 110 and a fabric120. The fabric 120 includes switches 160, 162, 164 which are coupled toeach other via ISLs and are each also connected to either a storagedevice or a computer system. For example, switch 164 is coupled to thecomputer system 144 and switch 162 is coupled to a storage device 142.The computer system 144 may be any suitable node device including adesktop computer, a server, or a user terminal. The FC fabric 110 isshown having three switches 150, 152 and 154 coupled together via ISLs.These switches are also each coupled to one or more storage devices.Switch 150 is coupled to storage devices 130 and 132, while switch 154is coupled to storage device 136, and switch 152 is coupled to storagedevice 138. The switches 150 and 160 each have a router port which areconnected to each other by link 170. By using router ports instead oftypical E_Ports, the fabrics 110 and 120 stay separate and do not mergeinto a single fabric.

Each of the storage devices shown in FIG. 1 may be any suitable nodedevice including a JBOD (Just a Bunch of Disks), RAID (Redundant Arrayof Inexpensive Disks) array, tape library, or network data store. Eachof the switches may have as few as two and as many as 256 or more ports.

As illustrated in FIG. 1, FC networks can be complex. As such,diagnosing possible errors or faulty links in these networks can bechallenging. To more efficiently troubleshoot large networks and improvethe speed, efficiency, and reliability of the networks, the inventorsprovide a method of diagnosing potential problems in inter-switch linksusing diagnostic ports (“D_Port”).

D_Ports are ports that are statically configured by the user for thepurpose of running diagnostics. In a preferred embodiment of the presentinvention, any FC port can be configured as a D_Port. However, once aport is configured as a D_Port, it will no longer be part of the fabricas it will not carry any inter-switch or data traffic. A D_Port willalso not merge fabrics. The D_Port is only used for link diagnosticpurposes and to isolate link level faults.

Accordingly, a D_Port is configured to run one or more link leveldiagnostic tests with minimal user intervention and providecomprehensive test results. The diagnostic tests performed by a D_Portachieve one or more of the following: 1) test both ends of a link'sconnectivity to validate that the link is within dB budget; 2) saturatea link with a representative SAN traffic profile to validate fabricperformance; and 3) monitor and determine trends for the integrity ofthe optics during its operational life cycle.

In a preferred embodiment of the present invention, two differentsoftware modules are used. The operation and configurability of D_Portsare handled by the fabric module. In the preferred embodiment, thefabric module implements the Fibre Channel Switch Fabric (FCSF)standard. The fabric module follows the FCSF standard for fabricinitialization processes, such as determining the E_ports, assigningunique domain IDs to switches, throttling the trunking process, anddistributing the domain and alias list to all switches in the fabric.The fabric module also performs D_Port related operations such asreading small form-factor pluggable (SFP) capabilities and sending outstate change notices (SCNs) of the D_Port to notify other modules in thepreferred embodiment. The fabric module performs some of these D_Portrelated operations through the use of switch drivers. The diag module isthe diagnostics module and implements the spinfab CLI command.

In some embodiments, D_Port diagnostics may be performed on E_portsconnected to ISLs between network switches in the fabric. In otherembodiments, D_Port diagnostics may be performed on F_ports connected tolinks to N_ports on devices. In yet other embodiments, D_Portdiagnostics may be performed on E_ports, F_ports, and N_ports. Forclarity, the discussion below is typically written in terms of, D_Portdiagnostics using E_ports, but similar techniques may be used for,D_Port diagnostics in F_ports and N_ports. Some of these conditions mayonly apply to E_ports, while others may only apply to F_ports orN_ports, and others may apply to any port.

FIG. 2 is a block diagram illustrating a FC network which implements oneembodiment of the use of D_Ports. FIG. 2 illustrates switches 260, 262and 264. Each of these switches is coupled to one or more storagedevices or computer systems. For example, switch 264 is coupled to thecomputer system 244, switch 262 is coupled to the storage device 242,and switch 260 is coupled to the storage device 240. Some of theswitches are also coupled to each other through ISLs. For example,switch 260 is coupled through ports 261 and 251 to switch 264.

Although illustrated in FIG. 2 as a single chassis, the switches 260 and264 may comprise a plurality of network switches in one or more chassis.In the network 200, hosts and devices are connected into a SAN using theswitches. (The numbers of storage devices and switches are illustrativeand by way of example only, and any desired number of storage devicesand switches may be connected in the network 200.)

As can be seen in FIG. 2, the connections between the switches createinter-switch links. As such, switches 264 and 260 are coupled to eachother through the inter-switch link 270. Each of the inter-switch linkscan be diagnosed in accordance with the preferred embodiment of thepresent invention. For example, the inter-switch link 270 can bediagnosed to detect potential faults and validate inter-switchconnectivity. To do this the two ports at each end of the link wouldfirst need to be configured as D_Ports. The exemplary steps involved inconfiguring the ports as D_Ports are illustrated in the flow chart ofFIG. 4.

FIG. 3 illustrates a basic block diagram of a switch 250, such asswitches 260, 262, or 264 according to the preferred embodiment of thepresent invention. A processor and I/O interface complex 202 providesthe processing capabilities of the switch 250. The processor may be anyof various suitable processors, including the Freescale or IBM PowerPC.The I/O interfaces may include low speed serial interfaces, such asRS-232, which use a driver/receiver circuit 204, or high-speed serialnetwork interfaces, such as Ethernet, which use a PHY circuit 206 toconnect to a local area network (LAN). Main memory or DRAM 208 and flashor permanent memory 210, are connected to the processor complex 202 toprovide memory to control and be used by the processor.

The processor complex 202 also includes an I/O bus interface 212, suchas a PCI bus, to connect to Fibre Channel circuits 214 and 216. In oneembodiment, the processor 202 runs the modules used in performing thediagnostics tests of the present invention. The Fibre Channel circuits214, 216 in the preferred embodiment each contain eight Fibre Channelports. Each port is connected to an external SERDES circuit 218, whichin turn is connected to a media interface 220, conventionally an SPF,which receives the particular Fibre Channel medium used to interconnectswitches used to form a fabric or to connect to various devices. SFPsaccording to the present invention include optical loopback capabilitiesto allow incoming frames to be looped back out within the SFP itself,rather than requiring a receiving ASIC to perform the looping within thenecessary electro-optical conversions. Further, SFPs according to thepresent invention include internal electrical loopback capabilities toallow near end testing. The processor 202 uses the fabric module tocommunicate with the SPFs to set both the electrical and opticalloopback modes.

As illustrated in FIG. 4, the method 400 starts at step 410 by disablingport 251. This is done so that the port is no longer part of the fabricand cannot carry data traffic. After the port has been disabled, themethod goes on to configure port 251 as a D_Port, in step 420. Afterport 251 has been configured as a D_Port, the next step is to disableand configure port 261 as a D_Port in steps 430 and 440, respectively.After both ports have been configured as D_Ports, the method connectsport 251 to port 261. When the two ports are connected, the methodenables port 251 and port 261, at steps 460 and 470, respectively. Inone embodiment, when both ports 251 and 261 have been have been enabled,the method is ready to start diagnosis at step 480. In anotherembodiment, the diagnostic tests will start automatically when thesecond port is enabled.

In one embodiment, the method 400 can be initiated by a user (e.g. anetwork administrator) through an application 248 accessed on anadministrative workstation such as the computer system 244 of FIG. 2.The application 248 may include one or more user interfaces or GUIs (notshown) that enable the user to identify the ISL intended to be diagnosedand turn on a diagnostic mode. Turning on the diagnostic mode may startrunning the method 400 automatically on the identified ISL. In otherembodiments, the user may initiate each step of the method 400. In oneembodiment, the user is able to decide which diagnostic tests to run onthe ISL. After the diagnostic tests have been performed, the result maybe presented to the user for analysis.

The application 248 may be provided on any desired non-volatilecomputer-readable program storage media including, but not limited to,all forms of optical and magnetic, including solid-state, storageelements, including removable media. The application workstation 244 maybe any desired type of computational device, including a virtualizedcomputer executing on any real hardware platform desired.

In addition to using the application 248, D_Port diagnostics may use acommand line interface (CLI) implemented on one of the switches 260 or264 to allow the user to initiate the diagnosis. In such an embodiment,the diagnosis can be initiated using a port identifier as a parameter tothe diagnostic command. The process may include querying the switches inthe network 200 for the list of ports and then sending D_Port diagnosticrequests for the selected ports. The diagnostic command may blockwaiting for completion of the diagnostic request. The command may alsoresult in a message indicating successful or unsuccessful completion ofthe diagnostic tests and/or displaying the test results.

The diagnostics tests initiated at step 480 of method 400 include one ormore of the following tests: 1) electrical loopback test; 2) opticalloopback test; and 3) link traffic test. In one embodiment, a testinitiator port, such as the port 510 illustrated in FIG. 5, initiatesthe diagnostic tests, while a port at the other end of the link,referred to as the test responder 520, responds. In one embodiment, theports are designated as an initiator or responder based on apre-determined characteristic of the ports such as their World WideNumber (WWN). For example, the port having a higher WWN may bedesignated as the initiator, while the port having a lower WWN may getdesignated as the responder.

As illustrated in FIG. 5, the electrical loopback test can occur ateither the initiator or responder ports locally. In contrast, theoptical loopback and the link traffic tests depend on the remote port tosend the test frames back and should be performed using the remote portas well as the local port. In one embodiment, in order to perform thelink traffic test both local and remote ports should be programmed toretransmit the frames received on that port. During the test, millionsof test frames are injected into the local port transmit circuit. Theseframes are transmitted onto the link through the local SFP. The remoteport receives the frames from the remote SFP and retransmits them backto the source port. The received frames are then checked for any errors.

In one embodiment, the link level tests involve an FC test utilityreferred to as spinfab. Spinfab is an online diagnostics command thatcan verify ISL links between switches at the maximum speed. The test isdone by setting up the routing functionality in the hardware such thattest frames received by an E_Port are retransmitted on the same E_Port.Several frames are then sent to ports attached to each active E_Portspecified. These frames are special frames which never occur duringnormal traffic and the default action for such frames is to route themback to the sender. The frames are circulated between switches until thetest stops them. The fabric module relies on the diag module for runningspinfab.

FIGS. 6 and 7 illustrate ladder and state diagrams, respectively,showing the state of the D_Ports during the high-level actions performedto achieve D_Port diagnosis, according to one embodiment. As illustratedin FIG. 7, the D_Port state machine will start with the state NOT_D_PORT(N_D). A port will be initialized to an N_D state after the portstructure is created. When the port receives a request to start the testwith the D_Port mode enabled by either an ONLINE command from the fabricmodule based on an instruction from a management utility to have theport go online or an inter-process call (IPS) from a management utility,such as diag using the spinfab command directing starting of the test,it will transition from N_D to D_PORT_INIT (D0). As shown in FIGS. 6 and7, the port will remain at the D0 state until it receives an ONLINEcommand or an IPC call to restart the test. At this point, if an SFPmodule exists, the port will transition to the D_CU_LOOPBACK (D1) stateto perform an electrical loopback test. However, if the port is at theD0 state and receives an ONLINE command or IPC call to restart the testwhile no SFP module exists, the port will transition to the D_PORT_FINAL(D7) state and no testing will be performed.

At the D_CU_LOOPBACK (D1) state, the port may transition to threedifferent states. If the SFP is not capable of an electrical loopback,the port will be toggled and it will go directly to the D_OPTIC_LOOPBACK(D3) state. However, if the SFP supports the electrical loopback test,it will be enabled and the port will go through all the states of E-portinitialization from ONLINE to AC_PORT or active. At this stage, if anAC_PORT SCN command is received from the fabric module and another portis running the link test, the port will transition to the D_CU_LOOP_WAIT(D1_1) state and wait for the other port. While at the D1_1 state, theport either waits for the other port to complete the link test or theswitch goes through fabric reconfiguration. In either case, the portwill transition from D1_1 to the D_CU_LOOP_TEST (D2) state. The port mayalso directly transition from D1 to D2, if an AC_PORT SCN is receivedand no other port is running the link test.

While at the D2 state, the procedure will start the electrical loopbacktest and will enable a child process completion signal. The procedurewill also start a timer for worst case scenario, in case the test doesnot complete. If the electrical loopback test fails or is aborted due totimeout, the port will transition from D2 to the D7 state and thediagnostic test will be stopped by setting the completion code tofailure code. However, if the electrical loopback test is completedsuccessfully, the port will transition from D2 to the D_OPTIC_LOOPBACK(D3) state. At this point, the electrical loopback will be cleared andthe port will be toggled by the fabric module.

At the D3 state, if the external cable is connected and the remote portSFP is capable of optical loopback, the port will perform an opticalloopback test by going through all the states of E-port initializationfrom ONLINE to AC_PORT. At this point, port configuration bits will bechecked during exchange link parameters (ELP) exchange and the opticalloopback mode is exchanged in the ELP. The port configuration bits arenewly defined bits in the flags field of the ELP. The new bits indicateD_Port mode and optical loopback capabilities. Flow splits at state D3depending on whether the port is sending or receiving the ELP. If theport is sending the ELP, the D_Port and optical loopback bits will beset in the ELP and a remote port configuration bit is cleared. If theremote port SFP is capable of optical loopback and the port is also inD_Port mode, the optical loopback mode will be set by the remote port ina returned ELP ACC. The port will then transition from D3 to theD_OPTIC_LOOP_BACK_INIT (D3_I) state. If the port is receiving the ELPand the ELP indicates D_Port and optical loopback, it will set theD_Port and optical loopback bits in the ELP ACC and transmit it. Theport will then enter optical loopback. The port will also set the remoteport configuration bit. Next, the port will transition toD_OPTIC_LOOP_BACK_TARGET (D3_T) state. However, if either SFP does notsupport optical loopback while in D_Port mode or both ports are notexchanging ELP and ELP ACC, the procedure will not be able to perform anoptical loopback and the port will transition to the D_REM_LOOPBACK (D5)state.

At the D3_I state, the port may transition to two different states. IfAC_PORT SCN is received and no other port is running the link test, theport will transition to the D_OPTIC_LOOP_BACK_TEST_INIT (D4_I) state.However, if AC_PORT SCN is received and another port is running theoptical loopback link test, the port will transition to theD_OPTIC_LOOP_BACK_INIT_WAIT (D0_I0) state and wait in that state. At theD4_I0 state, the port is either waiting for another port to complete thelink test or the switch is going through fabric reconfiguration. Theport will remain in the D4_I0 state until either DOMAIN_VALID SCN isreceived or the other port completes the link test. Either one of thoseconditions will cause the port to transition from the D4_I0 state to theD4_I state. While at the D4_I state, the port will determine whether ornot the optical lookback test was completed successfully. To do this,the port will start the optical loopback link test, enable child processcompletion signal, and start a timer for worst case scenario, in casethe test does not complete successfully. If the port determines that theoptical loopback test has failed or was aborted due to timeout, it willset a failure code and will transition back to D7. However, if itdetermines that the optical loopback test has completed successfully, itwill transition to the D_REM_LOOPBACK (D5) state.

Going back to the D3_T state, while at that state, the port is thetarget of the optical loopback test and will either proceed to theD_OPTIC_LOOP_BACK_TEST_TARGET (D4_T) state when an AC_PORT SCN isreceived or transition to the D5 state if it receives an offline SCN. Atthe D4_T state, the port will monitor the optical loopback test, enablechild process completion signal, and start a timer for worst casescenario, in case the test does not complete. If the port determinesthat the optical loopback test has failed or was aborted due to timeout,it will set a failure code and will transition back to D7. However, ifit finds that the optical loopback test has completed successfully, itwill transition to the D5 state.

When the port goes to the D5 state, the procedure will clear the opticalloopback mode in the transition. While at the D5 state, all loopbacksare removed and the port will be toggled to offline and back to online.The port will then go through all the states of E-port initializationfrom ONLINE to AC_PORT, if the external cable is connected. At thispoint, the port will check the remote port configuration bit. Ifcleared, the port was previously the initiator and now needs to be thetarget. If set, the port was previously the target and now needs to bethe initiator. At the D5 state, the port may transition to threedifferent states. If the ELP ACC with D_Port mode bit is set zero, theport will transition back to D7. This means that the port was not ableto perform an optical loopback test. As such, the port will besegmented. If the port is the initiator, it will send an ELP with theD_Port and remote optical loopback bits set. If it receives an ELP ACCwith the D_Port mode and optical loopback bits set, then the port willtransition to the D_REM_LOOP_BACK_INIT (D5_I) state. If the port is thetarget and an ELP with the D_Port and optical loopback bits set isreceived, the port will set the D_Port and optical loopback mode bits inthe ELP ACC, enter optical loopback mode, and transition to theD_REM_LOOP_BACK_TARGET (D5_T) state.

At the D5_I state, the port will either transition to theD_REM_LOOP_BACK_TEST_INIT (D6_I) state or to theD_REM_LOOP_BACK_INIT_WAIT (D6_I0) state. If an AC_PORT SCN is receivedand no other port is running the link test, then the port will move tothe D6_I state. However, if an AC_PORT SCN is received and another portis running the link test, the port will then transition to D6_I0. Theport will remain at the D6_I0 state until either a DOMAIN_VALID SCNcommand is received or the other port completes the link test. In eithercase, the port will transition from D6_I0 to the D6_I state. At the D6_Istate, the procedure starts the link test, enables a child processcompletion signal, and starts a timer for worst case scenario, in casethe test does not complete. The port will transition from D6_I to D7whether test is complete or not. If the test fails, the port willtransition with the failure code enabled. Otherwise it will transitionwith the failure code disabled.

Going back to state D5_T, the port at this state will either proceed toD_REM_LOOP_BACK_TEST_TARGET (D6_T), if an AC_PORT SCN is received, orwill transition to D7 if it receives an offline SCN. The port monitorsthe optical loopback test during state D6_T. The port transitions tostate DT with the failure code enabled or disabled depending on the testresults.

The D7 state is the final state after the tests are completed. Therewill be a completion code associated with this state. The completioncode will be SUCCESS if all the applicable tests completed successfully;otherwise it will contain the failure code, which will be passed to theCLI and will also be displayed as such.

A D_Port will go through all the steps associated with E-portinitialization up to link reset in LOOPBACK states. The D_Port mode isexchanged in opmode bits in the ELP payload in remote loopback. If theopmode bit does not match with that of the remote port, the port will beeither disabled or segmented. The usual E-port initialization protocolsteps performed after link reset will be skipped for a D_Port. Duringthe electrical and optical loopback testing, very high numbers of framesare circulated. The port counts the numbers of frames circulated in eachto measure the link traffic.

The D_Port diagnostic tests can be performed on long distance portsacross two different fabrics, and the D_Port tests can be performedwithout merging the fabrics. This can be done a single-mode fiberconnecting the long-wave SFPs or through DWDM links.

Accordingly, the D_Port diagnostic tests can be utilized to perform linklevel sanity tests in Fibre Channel networks. Such testing includesperforming an electrical loopback test, an optical loopback test, and alink traffic test. To achieve this diagnostic testing, two ports at eachend of a link are first identified and then statically configured by auser. The ports will be configured as D_Ports and as such will becompletely isolated from the fabric with no data traffic flowing throughthem. The ports are then used to send test frames to perform thediagnostic tests. In this manner, the D_Port diagnostic tests improvetesting capabilities for detecting single link faults.

Although described above generally in terms of FC fabrics and using FCterminology, the problems and techniques for graceful decommissioning ofports are not limited to FC fabrics and protocols, but may beimplemented using similar techniques to those described above inEthernet and other types of networks, including lossless networks usingIEEE Data Center Bridging.

It is to be understood that the above description is intended to beillustrative, and not restrictive. For example, the above-describedembodiments may be used in combination with each other. Many otherembodiments will be apparent to those of skill in the art upon reviewingthe above description. The scope of the invention therefore should bedetermined with reference to the appended claims, along with the fullscope of equivalents to which such claims are entitled. In the appendedclaims, the terms “including” and “in which” are used as theplain-English equivalents of the respective terms “comprising” and“wherein.”

What is claimed is:
 1. A device comprising: a processor; and a networkport coupled to the processor, the network port connected to a mediainterface module; wherein the media interface module includescapabilities to loopback incoming optical signals; wherein the processoris adapted to configure the media interface to not loopback incomingoptical signals; wherein the processor is adapted to provide adiagnostic frame indicating diagnostic mode and optical loopback to thenetwork port and to receive through the network port a diagnostic acceptframe indicating diagnostic mode and optical loopback; wherein theprocessor is adapted to provide frames to the network port fortransmission, upon receiving the diagnostic accept frame; and wherein aseries of signaling events occur over the link as part of diagnostictesting, the signaling including toggling the network port on and off.2. The device of claim 1, wherein the media interface includescapabilities to loopback incoming electrical signals, wherein theprocessor is adapted to configure the media interface to loopbackincoming electrical signals, and wherein the processor provideselectrical signals to the media interface when the media interface isconfigured to loopback incoming electrical signals.
 3. The device ofclaim 1, wherein the device is a switch.
 4. The device of claim 1,wherein the device is a host bus adaptor.
 5. The device of claim 1,wherein the network port and media interface conform to Fibre Channelstandards.
 6. A network comprising: a first device including a firstprocessor and a first network port coupled to the first processor, thenetwork port being connected to a first media interface; a second deviceincluding a second processor and a second network port coupled to thesecond processor, the network port being connected to a second mediainterface; and a link connected to the first device media interface andthe second device media interface; wherein each media interface includescapabilities to loopback incoming optical signals; wherein eachprocessor is adapted to configure the processor's respective mediainterface to loopback or not loopback incoming optical signals; whereinthe second processor is adapted to provide a diagnostic frame indicatingdiagnostic mode and optical loopback to the link after the first deviceand the second device media interfaces are configured to not loopbackincoming optical signals; wherein the first processor is adapted toreceive the diagnostic frame and in response return a diagnostic acceptframe indicating diagnostic mode and optical loopback and configure thefirst media interface to loopback incoming optical signals; and whereinthe second processor is adapted to receive the diagnostic accept frameand in response input frames onto the link; and wherein a series ofsignaling events occur over the link as part of diagnostic testing, thesignaling including toggling at least one of the first network port andthe second network port on and off.
 7. The network of claim 6, whereineach media interface includes capabilities to loopback incomingelectrical signals, wherein each processor is adapted to configure therespective media interface to loopback incoming electrical signals, andwherein each processor provides electrical signals to the respectivemedia interface when the respective media interface is configured toloopback incoming electrical signals.
 8. The network of claim 6, whereineach processor configures the media interface to not loopback incomingoptical signals; wherein the first processor provides a diagnostic frameindicating diagnostic mode and optical loopback to the link after themedia interfaces are configured to not loopback incoming opticalsignals; wherein the second processor receives the diagnostic frame andin response returns a diagnostic accept frame indicating diagnostic modeand optical loopback and configures the second media interface toloopback incoming optical signals, wherein the first processor receivesthe diagnostic accept frame and in response inputs frames onto the link.9. The network of claim 6, wherein each processor sets its respectivenetwork port to a diagnostic mode prior to the second processorinputting the frames onto the link.
 10. The network of claim 6, whereinthe first and second devices are switches.
 11. The network of claim 6,wherein the first device is a host bus adaptor and the second device isa switch.
 12. The network of claim 6, wherein the network ports andmedia interfaces conform to Fibre Channel standards.
 13. A methodcomprising: configuring a first device media interface and second devicemedia interface module to not loopback incoming optical signals;providing by the first device media interface module a diagnostic frameindicating diagnostic mode and optical loopback to a link, the linkconnecting the first device media interface module to the second devicemedia interface module, wherein the diagnostic frame is provided afterthe media interfaces are configured to not loopback incoming opticalsignals; receiving by the second device media interface the diagnosticframe and in response returning a diagnostic accept frame indicatingdiagnostic mode and optical loopback and configuring the second devicemedia interface to loopback incoming optical signals; and receiving bythe first device media interface the diagnostic accept frame and inresponse inputting frames onto the link when the second media interfacehas been configured to loopback the incoming optical signals; whereinsaid diagnostic frame and diagnostic accept frame exchange occurs priorto inputting the frames onto the link; and wherein a series of signalingevents occur over the link as part of diagnostic testing, the signalingincluding toggling at least one of two network ports connected to thelink on and off.
 14. The method of claim 13, further comprisingconfiguring one or more of the first and second device media interfacemodules to loopback incoming electrical signals, and providingelectrical signals to the one or more configured media interface moduleswhen the configured media interface is configured to loopback incomingelectrical signals.
 15. A method comprising: configuring a mediainterface not to loopback incoming optical signals; providing adiagnostic frame indicating diagnostic mode and optical loopback to anetwork port, the network port being connected to the media interface;wherein the diagnostic frame is provided after the media interface isconfigured to not loopback incoming optical signals; transmitting thediagnostic frame; receiving a diagnostic accept frame indicatingdiagnostic mode and optical loopback and in response providing framesfor transmission at the network port; and receiving a series of signalsas part of diagnostic testing, wherein at least some of the signalstoggle the network port on and off.
 16. The method of claim 15, whereinthe network port and the media interface conform to Fibre Channelstandards.
 17. A method comprising: configuring a media interface not toloopback incoming optical signals; receiving a diagnostic frameindicating diagnostic mode and optical loopback by a network port, thenetwork port being connected to the media interface, and the diagnosticframe being received after the media interface is configured to notloopback incoming optical signals; returning, in response to thediagnostic frame, a diagnostic accept frame indicating diagnostic modeand optical loopback and configuring the media interface to loopbackincoming optical signals; receiving frames at the network port after themedia interface is configured to loopback incoming optical signals; andreceiving a series of signals as part of diagnostic testing, wherein atleast some of the signals toggle the network port on and off.
 18. Themethod of claim 17, wherein said diagnostic frame and diagnostic acceptframe exchange occurs prior to receiving frames at the network port. 19.The method of claim 17, further comprising configuring the mediainterface to loopback incoming electrical signals and providingelectrical signals to the configured media interface when the mediainterface is configured to loopback incoming electrical signals.